﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Labs.Entity
{
    public delegate decimal PayFunc ();

    public class Payer
    {
        public void NoisyPay(IPayable te)
        {
            // 1 million lines of code!
            Console.WriteLine("Now Paying {0}",
                te.Name);
            decimal net = te.Pay();
            Console.WriteLine("Total paid: {0:c}", net);
        }

        public void FlexPay(PayFunc payfunc)
        {
            Console.WriteLine("Flexpaying {0:c}", payfunc());
        }

    }
}
